package com.itheima.health.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: liangWeiQUQ
 * @Description: 配置运行所有的请求域
 * @DateTime: 2021/3/4 9:34
 **/
@Configuration
public class CorsConfig implements WebMvcConfigurer {
    /**
             * @Author: 传闻中的梁大侠
             * @Date: 9:37 2021/3/4
             * @Parms [registry]
             * @ReturnType: void
             * @Description: 配置所有的请求域
            */

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedMethods("*")
                .allowCredentials(true);
    }

}
